xend: pass-through: Use parse_pci_name() in find_parent()
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 28 Jul 2009 15:16:32 +0000 (16:16 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 28 Jul 2009 15:16:32 +0000 (16:16 +0100)
Signed-off-by: Simon Horman <horms@verge.net.au>
tools/python/xen/util/pci.py

index b7e34da36de51b753d80d920ed940f1f3ae385d0..55077e5c1b2dda9616e2a40e7525f43bbf461d1d 100644 (file)
@@ -633,16 +633,7 @@ class PciDevice:
             if parent[0:3] == 'pci':
                 # We have reached the upmost one.
                 return None
-            else:
-                dev = {}
-                lst = parent.split(':')
-                dev['domain'] = '%04x' % int(lst[0], 16)
-                dev['bus'] = '%02x' % int(lst[1], 16)
-                lst = lst[2]
-                lst = lst.split('.')
-                dev['slot'] = '%02x' % int(lst[0], 16)
-                dev['func'] = '%x' % int(lst[1], 16)
-            return dev
+            return parse_pci_name(parent)
         except OSError, (errno, strerr):
             raise PciDeviceParseError('Can not locate the parent of %s',
                 self.name)